﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="DataSetTop10WaitStats" targetNamespace="http://tempuri.org/DataSetTop10WaitStats.xsd" xmlns:mstns="http://tempuri.org/DataSetTop10WaitStats.xsd" xmlns="http://tempuri.org/DataSetTop10WaitStats.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="SQLServerOptimizerConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="SQLServerOptimizerConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.SQLServerOptimizer.PL.WPF.Properties.Settings.GlobalReference.Default.SQLServerOptimizerConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="Top10WaitStatsTableAdapter" GeneratorDataComponentClassName="Top10WaitStatsTableAdapter" Name="Top10WaitStats" UserDataComponentName="Top10WaitStatsTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SQLServerOptimizerConnectionString (Settings)" DbObjectName="SQLServerOptimizer.dbo.GetWaitStats" DbObjectType="Function" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        GetWaitStats_1.Name, GetWaitStats_1.delta, GetWaitStats_1.Time, CASE 
                  WHEN GetWaitStats_2.total = 0
                     THEN 0 
                  ELSE GetWaitStats_1.delta * 100  /( GetWaitStats_2.total ) 
				  END  AS percentage
FROM            dbo.GetWaitStats(@ServerID, @TraceID) AS GetWaitStats_1 INNER JOIN
                             (SELECT        Time, SUM(delta) AS total
                               FROM            dbo.GetWaitStats(@ServerID, @TraceID) AS Expr1
                               GROUP BY Time) AS GetWaitStats_2 ON GetWaitStats_1.Time = GetWaitStats_2.Time</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="ServerID" ColumnName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@ServerID" Precision="0" Scale="0" Size="0" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="TraceID" ColumnName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="Input" ParameterName="@TraceID" Precision="0" Scale="0" Size="0" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Name" DataSetColumn="Name" />
              <Mapping SourceColumn="delta" DataSetColumn="delta" />
              <Mapping SourceColumn="Time" DataSetColumn="Time" />
              <Mapping SourceColumn="percentage" DataSetColumn="percentage" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="DataSetTop10WaitStats" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="DataSetTop10WaitStats" msprop:Generator_UserDSName="DataSetTop10WaitStats">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Top10WaitStats" msprop:Generator_TableClassName="Top10WaitStatsDataTable" msprop:Generator_TableVarName="tableTop10WaitStats" msprop:Generator_RowChangedName="Top10WaitStatsRowChanged" msprop:Generator_TablePropName="Top10WaitStats" msprop:Generator_RowDeletingName="Top10WaitStatsRowDeleting" msprop:Generator_RowChangingName="Top10WaitStatsRowChanging" msprop:Generator_RowEvHandlerName="Top10WaitStatsRowChangeEventHandler" msprop:Generator_RowDeletedName="Top10WaitStatsRowDeleted" msprop:Generator_RowClassName="Top10WaitStatsRow" msprop:Generator_UserTableName="Top10WaitStats" msprop:Generator_RowEvArgName="Top10WaitStatsRowChangeEvent">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnPropNameInTable="NameColumn" msprop:Generator_UserColumnName="Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="delta" msprop:Generator_ColumnVarNameInTable="columndelta" msprop:Generator_ColumnPropNameInRow="delta" msprop:Generator_ColumnPropNameInTable="deltaColumn" msprop:Generator_UserColumnName="delta" type="xs:int" minOccurs="0" />
              <xs:element name="Time" msprop:Generator_ColumnVarNameInTable="columnTime" msprop:Generator_ColumnPropNameInRow="Time" msprop:Generator_ColumnPropNameInTable="TimeColumn" msprop:Generator_UserColumnName="Time" type="xs:dateTime" minOccurs="0" />
              <xs:element name="percentage" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnpercentage" msprop:Generator_ColumnPropNameInRow="percentage" msprop:Generator_ColumnPropNameInTable="percentageColumn" msprop:Generator_UserColumnName="percentage" type="xs:int" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>